<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('action_logs', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->unsignedInteger('uid')->default(0)->comment('所属账号Id');
            $table->text('content')->nullable()->comment('内容');
            $table->string('ip', 15)->nullable()->comment('IP地址');
            $table->timestamps();
        });
        \DB::statement("ALTER TABLE `action_logs` comment '访问日志'");
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('action_logs');
    }
};
